home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Cookie
- -- Original Carnage Contest Weapon
- -- Script by DC, September 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.cookie={}
-
- -- Load & Prepare Ressources
- cc.cookie.gfx_wpn=loadgfx("weapons/cookie.bmp") -- Weapon Image
- setmidhandle(cc.cookie.gfx_wpn)
- cc.cookie.sfx_eat=loadsfx("eat.ogg") -- Eat Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Cookie
- --------------------------------------------------------------------------------
-
- cc.cookie.id=addweapon("cc.cookie","Cookie",cc.cookie.gfx_wpn,0,0) -- Add Weapon (0 uses)
-
- function cc.cookie.draw() -- Draw
- if (weapon_shots==0) then
- setblend(blend_alpha)
- setalpha(1)
- setcolor(255,255,255)
- drawinhand(cc.cookie.gfx_wpn,8,2,0.6)
- end
- end
-
- function cc.cookie.attack(attack) -- Attack
- if (weapon_shots<=0) then
- if (attack==1) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- -- Heal
- playerheal(0,25)
- -- Effect
- playsound(cc.cookie.sfx_eat)
- end
- end
- end